#ifndef SOLUTION_H_
#define SOLUTION_H_
class Solution 
{
public:
    int removeDuplicates(int A[], int n) 
	{
        // Start typing your C/C++ solution below
        // DO NOT write int main() function
        if(n<=1)
			return n;
		int lastIdx = 0;
		for(int i=1;i<n;i++)
		{
			if(A[i] != A[lastIdx])
			{
				lastIdx++;
				A[lastIdx] = A[i];
			}
		}

		return lastIdx+1;
    }
};
#endif